package com.jsmy.marketing.utils;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.jsmy.marketing.view.GlideCircleTransform;

/**
 * Created by PC_WLT on 2018/8/27.
 */

public class NetWork {

    public static void setImageGlide(Context context, String url, ImageView img) {
//        Log.i(TAG,"url="+url);
        GlideApp.with(context)
                .load(url)
                .dontAnimate()
                .diskCacheStrategy(DiskCacheStrategy.RESOURCE)
                .placeholder(img.getDrawable())
                .into(img);

    }
    public static void setImageGlideCircle(Context context, String url, ImageView img) {
//        Log.i(TAG,"url="+url);
        GlideApp.with(context)
                .load(url)
                .dontAnimate()
                .diskCacheStrategy(DiskCacheStrategy.RESOURCE)
                .placeholder(img.getDrawable())
                .transform(new GlideCircleTransform())
                .into(img);

    }
}
